package cn.caplike.demo.repository.design.pattern.callback;

/**
 * @author LiKe
 * @date 2019-12-05 17:12
 */
public class People {

    Printer printer = new Printer();

    /*
     * 同步回调
     */
    public void goToPrintSyn(Callback callback) {
        printer.print(callback);
    }

    /*
     * 异步回调
     */
    public void goToPrintASyn(Callback callback) {
        new Thread(() -> printer.print(callback)).start();
    }

}
